<template>
  <!-- 临时救助-->
  <div>
    <Form label-position="right" :label-width="400" :model="form">
<!--      <Row class="mb20">-->
<!--        <Col span="5" class="ivu-form-item-label" style="font-size: 14px;font-weight: bold">临时救助情况登记表</Col>-->
<!--      </Row>-->
      <Row class="mb20">
        <Col span="5" class="ivu-form-item-label">姓名：</Col>
        <Col span="6" class="ivu-form-item-content">
          <Input v-model="form.name"></Input>
        </Col>
      </Row>
      <Row class="mb20">
        <Col span="5" class="ivu-form-item-label">年龄：</Col>
        <Col span="6" class="ivu-form-item-content">
          <Input v-model="form.age" ></Input>
        </Col>
      </Row>
      <Row class="mb20">
        <Col span="5" class="ivu-form-item-label">性别：</Col>
        <Col span="6" class="ivu-form-item-content">
          <RadioGroup v-model="form.sex">
            <Radio label="男"></Radio>
            <Radio label="女"></Radio>
          </RadioGroup>
        </Col>
      </Row>
      <Row class="mb20">
        <Col span="5" class="ivu-form-item-label">家庭人口：</Col>
        <Col span="6" class="ivu-form-item-content">
          <Input v-model="form.familypeople" ></Input>
        </Col>
      </Row>
      <Row class="mb20">
        <Col span="5" class="ivu-form-item-label">家庭住址：</Col>
        <Col span="6" class="ivu-form-item-content">
          <Input v-model="form.familyaddress" ></Input>
        </Col>
      </Row>
      <Row class="mb20">
        <Col span="4" offset="1" class="ivu-form-item-label">是否享受低保：</Col>
        <Col span="6" class="ivu-form-item-content">
          <RadioGroup v-model="form.isSubsistenceAllowances">
            <Radio label="是"></Radio>
            <Radio label="否"></Radio>
          </RadioGroup>
        </Col>
      </Row>
      <Row class="mb20">
        <Col span="5" class="ivu-form-item-label">申请时间：</Col>
        <Col span="6" class="ivu-form-item-content">
<!--          <DatePicker v-model="form.time" type="date" placeholder="请选择" style="width: 200px"></DatePicker>-->
          <Input v-model="time1" readonly ></Input>
        </Col>
      </Row>
      <Row class="mb20">
        <Col span="5" class="ivu-form-item-label">情况说明：</Col>
        <Col span="6" class="ivu-form-item-content">
          <Input v-model="form.situation" type="textarea"></Input>
        </Col>
      </Row>
      <Row class="mb20">
        <Col span="5" class="ivu-form-item-label">情况反馈：</Col>
        <Col span="6" class="ivu-form-item-content">
          <Input v-model="form.feedback" type="textarea"></Input>
        </Col>
      </Row>
<!--      <Row class="mb20">-->
<!--        <Col span="13" class="ivu-form-item-label">-->
<!--          <Button @click="save()">提交</Button>-->
<!--        </Col>-->
<!--      </Row>-->
    </Form>
  </div>
</template>

<script>
// import { uploadPic } from '@/api/common'
export default {
  name: 'temporaryAssistance',
  data () {
    return {
      form: {
        name: '',
        sex: '',
        age: '',
        familypeople: '',
        familyaddress: '',
        isSubsistenceAllowances: '',
        time: '',
        situation: '',
        feedback: '',
        comm_time: ''
      }
      // disableItem: {
      //   disableShow: true,
      //   itemInfoFormTitle: '',
      //   itemInfoForm: {}
      // }
    }
  },
  props: {
    unemploymentItem1: Object,
    // disableItem: Object
    time1: String
  },
  watch: {
    // 回显
    unemploymentItem1 (a) {
      this.form = a
    }
  },
  methods: {
    save () {
      if (!this.form.name) {
        this.$Notice.error({ title: '请填写姓名', desc: '' })
        return
      }
      if (!this.form.sex) {
        this.$Notice.error({ title: '请选择性别', desc: '' })
        return
      }
      if (!this.form.age) {
        this.$Notice.error({ title: '请填写年龄', desc: '' })
        return
      }
      if (!this.form.isSubsistenceAllowances) {
        this.$Notice.error({ title: '请选择是否是低保', desc: '' })
        return
      }
      if (!this.form.familyaddress) {
        this.$Notice.error({ title: '请填写家庭地址', desc: '' })
        return
      }
      this.form.time = this.time1
      this.form.comm_time = this.form.time
      this.$emit('form', this.form)
    }
    /*    beforeUpload (file) {
      let that = this
      const reader = new FileReader()
      reader.readAsDataURL(file)
      reader.onload = () => {
        let index = reader.result.indexOf('base64,') + 7
        that.upPicData.list = reader.result.substring(index)
        that.upPic(that.upPicData)
      }
      return false
    },
    // 上传图片
    upPic (obj) {
      uploadPic(obj).then(res => {
        if (res.data.data.status === '1') {
          let imgurl = res.data.data.url
          let list = this.documentlist[this.formItem.paramIndex]
          if (list.img_urls) {
            list.img_urls.push(imgurl)
          } else {
            list.img_urls = [imgurl]
          }
          this.temp_photo = imgurl
        } else {
          this.$Notice.error({ title: '上传失败', desc: res.data.data.msg })
        }
      })
    } */
  }
  // mounted () {
  //   this.time = this.time.getFullYear() + (this.time.getMonth() + 1) + this.time.getData()
  // }
}
</script>

<style scoped>
  .layout{
    background: #f5f7f9;
    position: relative;
    border-radius: 4px;
    overflow: hidden;
  }
  .demo-spin-icon-load{
    animation: ani-demo-spin 1s linear infinite;
  }
  .demo-spin-col{
    height: 100px;
    position: relative;
  }
  .mb20 {
    margin-bottom: 20px;
  }
  .layout-logo{
    width: 110px;
    height: 30px;
    background: #5b6270;
    border-radius: 3px;
    float: left;
    position: relative;
    top: 15px;
    left: 20px;
  }
  .layout-nav{
    width: 420px;
    margin: 0 auto;
    margin-right: 20px;
  }
  .layout-footer-center{
    text-align: center;
  }
  .content{
    height: auto;
    background-color:white;
    padding-left: 30px;
    padding-right: 30px;
  }
  .items{
    height:40px;
    line-height:40px
  }
  .info{
    height: auto;
    background-color:#F8F8FF;
    padding-left: 70px;
    padding-right: 70px;
  }
  .header{
    height: 40px;
    background-color: white;
    line-height: 40px;
    border-bottom: 1px solid orangered;
  }
  .info-middle{
    height: 330px;
    background-color: #F8F8FF;
    padding-left: 70px;
    padding-right: 70px;
    padding-bottom: 15px;
  }
  .titles{
    height: 35px;
    background-color: black;
    line-height: 35px;
    font-size: 1rem;
    color: white;
    padding-left: 10px;
  }
  .nopadding .ivu-table-cell {
    padding: 0px 0px;
  }
  .head_btn {
    height:45px;
    line-height:45px;
    width: 130px;
    float: left;
    margin-right: 20px;
  }
  .subsidy-img {
    height: 140px;
    width: 120px;
    position: absolute;
    right: 8%;
    top: 11%;
  }
  .centerimg {
    text-align: center;
  }
  .pre_img_style {
    height:500px;
    width:auto;
    max-width: 500px;
  }
</style>
